package com.itheima.controller;

import com.itheima.domain.mongo.Visitor;
import com.itheima.service.mongo.VisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/visitor")
public class VisitorController{

    @Autowired
    private VisitorService visitorService;

    @GetMapping("/findVisitorList")
    public List<Visitor> findVisitorList(Long userId, String lastAccessTime) {
        return visitorService.findVisitorList(userId, lastAccessTime);
    }
}
